﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.EquipmentManagement;

namespace Digitalmes.Model.EquipmentManagement
{
    /// <summary>
    /// 设备点检模板
    /// </summary>
	[Table("EquipmentSpotTemplate")]

    [Display(Name = "_Model.EquipmentSpotTemplate")]
    public class EquipmentSpotTemplate : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._EquipmentSpotTemplate._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._EquipmentSpotTemplate._Name")]
        [Comment("模板名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Name { get; set; }
        [Display(Name = "_Model._EquipmentSpotTemplate._Description")]
        [Comment("模板说明")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string Description { get; set; }
        [Display(Name = "_Model._EquipmentSpotTemplate._SpotCycle")]
        [Comment("点检周期")]
        [Precision(18,2)]
        [Required(ErrorMessage = "Validate.{0}required")]
        public decimal? SpotCycle { get; set; }
        [Display(Name = "_Model._EquipmentSpotTemplate._SysAuto")]
        [Comment("系统自动")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool? SysAuto { get; set; }
        [Display(Name = "_Model._EquipmentSpotItem._Template")]
        [InverseProperty("Template")]
        public List<EquipmentSpotItem> EquipmentSpotItem_Template { get; set; }
        [Display(Name = "_Model._EquipmentSpotTemplate._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
